#!/user/bin/env python
# -*- coding: utf-8 -*-
'''
 @Time    : 2018/5/10 21:26
 @File    : namespace_utils.py
 @desc    :
'''
from socketIO_client import BaseNamespace


def get_extend_context(namespace):
    '''
    获取命名空间的扩展对象
    :param namespace:
    :return:
    '''
    return namespace.__dict__['_io'].__dict__['extend_context'] if namespace and isinstance(namespace, BaseNamespace) else {}
